package com.core.inheritance.a.impl;

import com.core.inheritance.a.Building;
import com.core.inheritance.a.Site;
import com.core.inheritance.a.Structure;
import java.util.List;

/**
 *
 * @author Sunil
 */
public class Test {

    public static void main(String[] args) {
        Site s1 = new SiteOneImpl();
        List<? extends Structure> list = s1.structures();
        
        Site s2 = new SiteTwoImpl();
        list = s2.structures();

        showBuildings(new SiteTwoImpl().structures());
//        show(s1.structures());
    }

    public static void showBuildings(List<? extends Building> list) {
        for(Building b : list){
            b.floor();
        }
    }
    public static void show(List<Structure> list) {
        for(Structure b : list){
            b.info();
        }
    }
}
